 */**************************************************
 * Copyright (c) 2006 Javageo.com. All Rights Reserved.
 * 
 * This software is provided "AS IS," without a warranty of any kind.
 * You acknowledge that this software is not designed, licensed or intended
 * for use in the design, construction, operation or maintenance of any
 * nuclear facility.
 * keep the world peace and green!
 * JAVA Screndit 1.0                            **
 * Version#1.0 beta                             **
 * By Goen Ghin                                **
 * Date: November 2006    @Pekanbaru-Indonesia  **
 ***************************************************/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;


public class ButtonView extends JPanel {

	public JButton[] button;
	//for creating the name of the image file 24*24
	public String[] imgName = {"ViewFromWest.gif","ViewFromEast.gif", 
	                            "ViewFromBottom.gif", "ViewFromTop.gif", "UnZoom.gif", 
	                            "Zoom.gif","Reset.gif",
	                            "Center.gif","PlayAnimate.gif","StopAnimate.gif"};
	                               
	//for creating the tipText for the toolbar
	public String[] tipText = {"View From West ", "View From East", 	                           
	                           "View From Bottom", "Top" ,"UnZoom","Zoom","Reset",
	                           "Go to Center","Play Animation","Stop Animate"};

	public JToolBar jb;
	
	JScrollBar slidersX;
	JScrollBar slidersY;
    JScrollBar slidersZX;
    JScrollBar slidersZY;
    JScrollBar slidersRot;
    JScrollBar slidersScaleX;
    JScrollBar slidersScaleY;
     JScrollBar slidersScaleXY;
    
	public ButtonView() {
		buttonPanel.setLayout(new GridLayout(5, 1, 0, 0));
    
    // Create the buttons.
    button = new JButton[10];
    jb = new JToolBar();
    
    for (int i = 0; i < imgName.length; i++) {
		//	if (i == 4 || i == 8 )
			//for adding separator to the toolBar
		//	jb.addSeparator();
			//for adding the buttons to toolBar
			jb.add(button[i] = new JButton(new ImageIcon(ClassLoader.getSystemResource(imgName[i]))));
			//for setting the ToolTipText to the button
			button[i].setToolTipText(tipText[i]);
			buttonPanel.add(button[i]);
		}
    
    
    setLayout(new BorderLayout());
    //add(new JLabel("Select an "), BorderLayout.NORTH);
    buttonPanel.setBorder(new TitledBorder(new EtchedBorder(),"Image Action")); 
    
    add(buttonPanel, BorderLayout.CENTER);
    
        slidersX = new JScrollBar(JScrollBar.HORIZONTAL,0,0,-400,400);
		
		slidersY = new JScrollBar(JScrollBar.HORIZONTAL,0,0,-400,400);
		
		slidersZX = new JScrollBar(JScrollBar.HORIZONTAL,0,0,-20,20);
		slidersZY = new JScrollBar(JScrollBar.HORIZONTAL,0,0,-20,20);
		
		slidersRot = new JScrollBar(JScrollBar.HORIZONTAL,0,0,-180,180);
		
		//kolom vertikal 10 baris 1
		sliderPanel.setLayout(new GridLayout(19, 1, 0, 0));
	
	
	 //  sliderPanel.add(new JLabel("Translation"));
	   sliderPanel.setBorder(new TitledBorder(new EtchedBorder(),"Tranformation")); 
	  
	   sliderPanel.add(new JLabel("  -X                         +X"));
	   sliderPanel.add(slidersX);
	   sliderPanel.add(new JLabel("  -Y                         +Y"));	   
	   sliderPanel.add(slidersY);
	   sliderPanel.add(new JLabel("Shear X & Y"));
	   sliderPanel.add(new JLabel("  0                         +180 X"));
	   sliderPanel.add(slidersZX);	   
	   sliderPanel.add(slidersZY);
	   
	   sliderPanel.add(new JLabel("Rotate"));
	   sliderPanel.add(new JLabel("  0                         +180"));
	   sliderPanel.add(slidersRot);
	   
	   slidersScaleX = new JScrollBar(JScrollBar.HORIZONTAL,0,0,0,20);
	   slidersScaleY = new JScrollBar(JScrollBar.HORIZONTAL,0,0,0,20);
	   sliderPanel.add(new JLabel("Scale X & Y"));
	   sliderPanel.add(new JLabel("   Min                        Max"));
	   sliderPanel.add(slidersScaleX);
	   sliderPanel.add(slidersScaleY);
	   sliderPanel.add(new JLabel("Scale XY"));
	   slidersScaleXY = new JScrollBar(JScrollBar.HORIZONTAL,0,00,0,500);
	   slidersScaleXY.setValue(250);
	   sliderPanel.add(slidersScaleXY);
	   add(sliderPanel, BorderLayout.SOUTH);
    
	}
	

  // button panel
  private JPanel buttonPanel = new JPanel();
  private JPanel sliderPanel = new JPanel();

}
